#pragma once

#include <QMainWindow>
#include <QLabel>
#include "Game.h"
#include "GameBoard.h"

namespace Ui {
    class MainWindow;
}

// 主窗口
class MainWindow: public QMainWindow {
    Q_OBJECT

    private: Ui::MainWindow* ui;            // 界面
    private: QIcon mButtonPauseImage;       // "暂停"按钮的图片
    private: QIcon mButtonPlayMusicImage;   // "播放音乐"按钮的图片
    private: QIcon mButtonResumeImage;      // "继续"按钮的图片
    private: QIcon mButtonStopMusicImage;   // "停止音乐"按钮的图片
    private: GameBoard mGameBoard;          // 游戏区域
    private: GameBoard mPreview;            // 预览区域
    private: Game mGame;                    // 游戏
    private: QLabel mLabelDifficulty;       // 难度值标签
    private: QLabel mLabelScore;            // 得分值标签

    public: explicit MainWindow(QWidget* parent = nullptr);
    public: ~MainWindow();
    private: bool eventFilter(QObject*, QEvent*);
    private: void keyPressEvent(QKeyEvent*);
    private slots: void on_buttonMusic_clicked();
    private slots: void on_buttonPause_clicked();
    private slots: void on_buttonStart_clicked();
    private slots: void onDifficultyUp(int);
    private slots: void onGameOver(bool);
    private slots: void onScore(int);
};
